<!-- HTML header for doxygen 1.8.14-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="cache-control" content="max-age=86400"/>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GBDK 2020 Docs: gbdk-lib/include/gb/isr.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen_extra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">GBDK 2020 Docs
   &#160;<span id="projectnumber">4.4.0</span>
   </div>
   <div id="projectbrief">API Documentation for GBDK 2020</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('isr_8h.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a>  </div>
  <div class="headertitle">
<div class="title">isr.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;<a class="el" href="stdint_8h_source.html">stdint.h</a>&gt;</code><br />
<code>#include &lt;types.h&gt;</code><br />
</div>
<p><a href="isr_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structisr__vector__t.html">isr_vector_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structisr__nested__vector__t.html">isr_nested_vector_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a2cf2cba8468992868fe1f6b6448ffae2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="isr_8h.html#a2cf2cba8468992868fe1f6b6448ffae2">VECTOR_STAT</a>&#160;&#160;&#160;0x48</td></tr>
<tr class="separator:a2cf2cba8468992868fe1f6b6448ffae2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a84ca82d76186433c1ec77fde7652b827"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="isr_8h.html#a84ca82d76186433c1ec77fde7652b827">VECTOR_TIMER</a>&#160;&#160;&#160;0x50</td></tr>
<tr class="separator:a84ca82d76186433c1ec77fde7652b827"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9c51a56a79576c33fcc98579bf7153a1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="isr_8h.html#a9c51a56a79576c33fcc98579bf7153a1">VECTOR_SERIAL</a>&#160;&#160;&#160;0x58</td></tr>
<tr class="separator:a9c51a56a79576c33fcc98579bf7153a1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac93f10ff354ca76f4030f64a8496303f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="isr_8h.html#ac93f10ff354ca76f4030f64a8496303f">VECTOR_JOYPAD</a>&#160;&#160;&#160;0x60</td></tr>
<tr class="separator:ac93f10ff354ca76f4030f64a8496303f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a73769fed9338af86fdb7df35d7b82620"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="isr_8h.html#a73769fed9338af86fdb7df35d7b82620">ISR_VECTOR</a>(ADDR,  FUNC)&#160;&#160;&#160;static const <a class="el" href="structisr__vector__t.html">isr_vector_t</a> <a class="el" href="asm_2types_8h.html#a66d3e9555a86fa871932c5f60834c67e">AT</a>((ADDR)) __ISR_ ## ADDR = {0xc3, (void *)&amp;(FUNC)};</td></tr>
<tr class="separator:a73769fed9338af86fdb7df35d7b82620"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a78f9ef588aaf221023e48899898d566b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="isr_8h.html#a78f9ef588aaf221023e48899898d566b">ISR_NESTED_VECTOR</a>(ADDR,  FUNC)&#160;&#160;&#160;static const <a class="el" href="structisr__nested__vector__t.html">isr_nested_vector_t</a> <a class="el" href="asm_2types_8h.html#a66d3e9555a86fa871932c5f60834c67e">AT</a>((ADDR)) __ISR_ ## ADDR = {{0xfb, 0xc3}, (void *)&amp;(FUNC)};</td></tr>
<tr class="separator:a78f9ef588aaf221023e48899898d566b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a40dca48ca391581d7f67d8697533cf30"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structisr__vector__t.html">isr_vector_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="isr_8h.html#a40dca48ca391581d7f67d8697533cf30">isr_vector_t</a></td></tr>
<tr class="separator:a40dca48ca391581d7f67d8697533cf30"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a99e64ac886740db0eb63d8ed0235b5c7"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structisr__nested__vector__t.html">isr_nested_vector_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="isr_8h.html#a99e64ac886740db0eb63d8ed0235b5c7">isr_nested_vector_t</a></td></tr>
<tr class="separator:a99e64ac886740db0eb63d8ed0235b5c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Macros for creating raw interrupt service routines (ISRs) which do not use the default GBDK ISR dispatcher.</p>
<p>Handlers installed this way will have less overhead than ones which use the GBDK ISR dispatcher. </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a2cf2cba8468992868fe1f6b6448ffae2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2cf2cba8468992868fe1f6b6448ffae2">&#9670;&nbsp;</a></span>VECTOR_STAT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define VECTOR_STAT&#160;&#160;&#160;0x48</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Address for the STAT interrupt vector </p>

</div>
</div>
<a id="a84ca82d76186433c1ec77fde7652b827"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a84ca82d76186433c1ec77fde7652b827">&#9670;&nbsp;</a></span>VECTOR_TIMER</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define VECTOR_TIMER&#160;&#160;&#160;0x50</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Address for the TIMER interrupt vector </p>

</div>
</div>
<a id="a9c51a56a79576c33fcc98579bf7153a1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9c51a56a79576c33fcc98579bf7153a1">&#9670;&nbsp;</a></span>VECTOR_SERIAL</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define VECTOR_SERIAL&#160;&#160;&#160;0x58</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Address for the SERIAL interrupt vector </p>

</div>
</div>
<a id="ac93f10ff354ca76f4030f64a8496303f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac93f10ff354ca76f4030f64a8496303f">&#9670;&nbsp;</a></span>VECTOR_JOYPAD</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define VECTOR_JOYPAD&#160;&#160;&#160;0x60</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Address for the JOYPAD interrupt vector </p>

</div>
</div>
<a id="a73769fed9338af86fdb7df35d7b82620"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a73769fed9338af86fdb7df35d7b82620">&#9670;&nbsp;</a></span>ISR_VECTOR</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ISR_VECTOR</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ADDR, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">FUNC&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;static const <a class="el" href="structisr__vector__t.html">isr_vector_t</a> <a class="el" href="asm_2types_8h.html#a66d3e9555a86fa871932c5f60834c67e">AT</a>((ADDR)) __ISR_ ## ADDR = {0xc3, (void *)&amp;(FUNC)};</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Creates an interrupt vector at the given address for a raw interrupt service routine (which does not use the GBDK ISR dispatcher)</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ADDR</td><td>Address of the interrupt vector, any of: <a class="el" href="isr_8h.html#a2cf2cba8468992868fe1f6b6448ffae2">VECTOR_STAT</a>, <a class="el" href="isr_8h.html#a84ca82d76186433c1ec77fde7652b827">VECTOR_TIMER</a>, <a class="el" href="isr_8h.html#a9c51a56a79576c33fcc98579bf7153a1">VECTOR_SERIAL</a>, <a class="el" href="isr_8h.html#ac93f10ff354ca76f4030f64a8496303f">VECTOR_JOYPAD</a> </td></tr>
    <tr><td class="paramname">FUNC</td><td>ISR function supplied by the user</td></tr>
  </table>
  </dd>
</dl>
<p>This cannot be used with the VBLANK interrupt.</p>
<p>Do not use this in combination with interrupt installers that rely on the default GBDK ISR dispatcher such as <a class="el" href="gb_8h.html#aa1b9d8d215e844834d2be5c10969d712">add_TIM()</a>, <a class="el" href="gb_8h.html#a623f1ed8ee1d48bfa6e884d546991a6f">remove_TIM()</a> (and the same for all other interrupts).</p>
<p>Example: </p><div class="fragment"><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="isr_8h.html">gb/isr.h</a>&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> TimerISR() __critical __interrupt {</div>
<div class="line"><span class="comment">// some ISR code here</span></div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><a class="code" href="isr_8h.html#a73769fed9338af86fdb7df35d7b82620">ISR_VECTOR</a>(<a class="code" href="isr_8h.html#a84ca82d76186433c1ec77fde7652b827">VECTOR_TIMER</a>, TimerISR)</div>
<div class="ttc" id="aisr_8h_html"><div class="ttname"><a href="isr_8h.html">isr.h</a></div></div>
<div class="ttc" id="aisr_8h_html_a73769fed9338af86fdb7df35d7b82620"><div class="ttname"><a href="isr_8h.html#a73769fed9338af86fdb7df35d7b82620">ISR_VECTOR</a></div><div class="ttdeci">#define ISR_VECTOR(ADDR, FUNC)</div><div class="ttdef"><b>Definition:</b> isr.h:52</div></div>
<div class="ttc" id="aisr_8h_html_a84ca82d76186433c1ec77fde7652b827"><div class="ttname"><a href="isr_8h.html#a84ca82d76186433c1ec77fde7652b827">VECTOR_TIMER</a></div><div class="ttdeci">#define VECTOR_TIMER</div><div class="ttdef"><b>Definition:</b> isr.h:17</div></div>
</div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><a class="el" href="isr_8h.html#a78f9ef588aaf221023e48899898d566b">ISR_NESTED_VECTOR</a>, <a class="el" href="sms_8h.html#aefda0091b2934571a11e07b512735f50">set_interrupts</a> </dd></dl>

</div>
</div>
<a id="a78f9ef588aaf221023e48899898d566b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a78f9ef588aaf221023e48899898d566b">&#9670;&nbsp;</a></span>ISR_NESTED_VECTOR</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ISR_NESTED_VECTOR</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ADDR, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">FUNC&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;static const <a class="el" href="structisr__nested__vector__t.html">isr_nested_vector_t</a> <a class="el" href="asm_2types_8h.html#a66d3e9555a86fa871932c5f60834c67e">AT</a>((ADDR)) __ISR_ ## ADDR = {{0xfb, 0xc3}, (void *)&amp;(FUNC)};</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Creates an interrupt vector at the given address for a raw interrupt service routine allowing nested interrupts</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ADDR</td><td>Address of the interrupt vector, any of: <a class="el" href="isr_8h.html#a2cf2cba8468992868fe1f6b6448ffae2">VECTOR_STAT</a>, <a class="el" href="isr_8h.html#a84ca82d76186433c1ec77fde7652b827">VECTOR_TIMER</a>, <a class="el" href="isr_8h.html#a9c51a56a79576c33fcc98579bf7153a1">VECTOR_SERIAL</a>, <a class="el" href="isr_8h.html#ac93f10ff354ca76f4030f64a8496303f">VECTOR_JOYPAD</a> </td></tr>
    <tr><td class="paramname">FUNC</td><td>ISR function</td></tr>
  </table>
  </dd>
</dl>
<p>This cannot be used with the VBLANK interrupt</p>
<p>The LCD STAT vector (<a class="el" href="isr_8h.html#a2cf2cba8468992868fe1f6b6448ffae2">VECTOR_STAT</a>) cannot be used in the same program as <code>stdio.h</code> since they install an ISR vector to the same location.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="isr_8h.html#a73769fed9338af86fdb7df35d7b82620">ISR_VECTOR</a> </dd></dl>

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="a40dca48ca391581d7f67d8697533cf30"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a40dca48ca391581d7f67d8697533cf30">&#9670;&nbsp;</a></span>isr_vector_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structisr__vector__t.html">isr_vector_t</a> <a class="el" href="structisr__vector__t.html">isr_vector_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a99e64ac886740db0eb63d8ed0235b5c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a99e64ac886740db0eb63d8ed0235b5c7">&#9670;&nbsp;</a></span>isr_nested_vector_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structisr__nested__vector__t.html">isr_nested_vector_t</a> <a class="el" href="structisr__nested__vector__t.html">isr_nested_vector_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.14-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
</div>
</body>
</html>
